from bottle import Bottle, run
import json

from handler.translated import translate
app = Bottle()


@app.get('/hello')
def hello():
    data = {
        'name': 'John',
        'age': 30,
        'city': 'New York'
    }
    return json.dumps(data)


@app.get('/translated')
def translated():
    text = translate()

    data = {
        'name': text.text,
        'age': 30,
        'city': 'New York'
    }
    return json.dumps(data)



if __name__ == "__main__":
    run(app,host='localhost', port=8081, debug=True)